<template>
  <div>
    <table>
      <thead>
        <tr>
          <th>序号</th>
          <th>姓名</th>
          <th>邮箱</th>
          <th>手机号</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item, index) in data" :key="item.id">
          <td>{{ index + 1 }}</td>
          <td>{{ item.name }}</td>
          <td>{{ item.email }}</td>
          <td>{{ item.phone }}</td>
          <td>
          <slot :item="item"></slot>
          </td>

        </tr>
      </tbody>
    </table>
        
  </div>
        
</template>

<script>
  export default {
    name: "helloWorld",
    props: {
     data:Array 
    },
    data() {
      return {
        msg: "Welcome to Your Vue.js App",
      };  
    }
  };
</script>

<style scoped>
  table {
    margin: 20px auto;
    border-collapse: collapse;
   width: 500px;
  }
  th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
  }
  th {
    background-color: #f2f2f2;
  }
tbody  tr:hover {
    background-color: #f5f5f5;
    color:red
  }

</style>